#ifndef PARSER_H
#define PARSER_H

#include <string>
#include <boost/regex.hpp>
#include <boost/shared_ptr.hpp>

class Parser
{
  struct impl;
  boost::shared_ptr<impl> pimpl_;

public:
  typedef boost::shared_ptr< Parser > shared_ptr;
  Parser();
  ~Parser();

  virtual void parse(const std::string& message);

protected:
  virtual void time_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void gs_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void gyr_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void flag_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void ball_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void uj_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void hj_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void frp_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void mypos_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;
  virtual void player_callback(const boost::match_results<std::string::const_iterator>& m, int i) ;

};

#endif//PARSER_H
